package cellsInRange;

import java.util.ArrayList;
import java.util.List;

public class Solution {
    public List<String> cellsInRange(String s) {
        char startC = s.charAt(0);
        int startIndex = s.charAt(1) - '0';
        // 结束
        char endC = s.charAt(3);
        int endIndex = s.charAt(4) - '0';

        List<String> rs = new ArrayList<>();
        // 两层遍历
        for (char c = startC; c <= endC; c++) {
            for (int i = startIndex; i <= endIndex; i++) {
                rs.add(Character.toString(c) + i);
            }
        }
        return rs;
    }
}
